package vn.anhqn.englishsentensetranslator.base.networkTask;

import java.io.IOException;
import java.net.SocketTimeoutException;

import org.apache.http.conn.ConnectTimeoutException;

import android.os.AsyncTask;
import android.os.Handler;

public abstract class BaseTask<Params, Result> extends AsyncTask<Params, Void, Result> {
	@Override
	protected Result doInBackground(Params... params) {
		Result result = null;
		try {
			result = onTaskRunning(params[0]);
		} catch (ConnectTimeoutException eC) {

		} catch (SocketTimeoutException eSock) {

		} catch (IOException eIo) {

		} catch (Exception e) {
		}
		return result;
	}

	public abstract Result onTaskRunning(Params params) throws SocketTimeoutException, ConnectTimeoutException,
			IOException, Exception;
}
